package com.wyz.module.comm.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;

/**
 * @author 无涯子
 * @version 1.0
 * @date 2024/4/14 17:26:00
 */
@ApiModel("返回状态码对象")
public enum ResultCode {
    /***
     * 成功
     */
    SUCCESS(200, "成功"),
    /***
     * 参数错误
     */
    PARAM_ERROR(201,"参数错误"),
    /***
     * 未找到资源
     */
    NOT_FOUND(404,"未找到资源"),
    /***
     * 服务器错误
     */
    FAIL(500,"服务器错误");

    @Getter
    @ApiModelProperty("返回状态码")
    private final int code;

    @Getter
    @ApiModelProperty("返回信息")
    private final String message;

    ResultCode(int code,String message){
        this.code = code;
        this.message = message;
    }
}
